#include <unistd.h>
#include <pthread.h>
#include <time.h>

int main() {
  struct timespec tout;
  pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
  pthread_mutex_lock(&lock);
  
  time(&tout.tv_sec);
  puts(ctime(&tout.tv_sec));
  tout.tv_sec += 10;
  pthread_mutex_timedlock(&lock, &tout);

  time(&tout.tv_sec);
  puts(ctime(&tout.tv_sec));
  return 0;
}
